<?php
namespace Application\Repository;
use Doctrine\ORM\EntityRepository;

class LoadFacebookRepository extends AbstractRepository
{
    protected $entity="Application\\Entity\\LoadFacebook";
    
    public function getUserLoad($uid,$type,$number = 1)
    {
        $dql = "SELECT c FROM $this->entity c WHERE c.uid=?1 OR c.type=?2";

        return $this->getEntityManager()->createQuery($dql)
                             ->setParameter(1, $uid)
                             ->setParameter(2, $type)
                             ->setMaxResults($number)
                             ->getResult();
    }
    
   
}